﻿Public Class F_TimKiemKhachHang
    Private _tenkh As String
    Public Property Tenkh() As String
        Get
            Return _tenkh
        End Get
        Set(ByVal value As String)
            _tenkh = value
        End Set
    End Property
    Private _makh As Integer

    Public Property Makh() As Integer
        Get
            Return _makh
        End Get
        Set(ByVal value As Integer)
            _makh = value
        End Set
    End Property
    Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
        Dim f As New F_KhachHang
        f.ShowDialog
    End Sub

    Sub loadGridControl()
        GControl.DataSource = BUSKhachHang.KhachHang_Load()
    End Sub
    Private Sub F_TimKiemKhachHang_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        loadGridControl()
    End Sub

    Private Sub SimpleButton2_Click(sender As Object, e As EventArgs) Handles SimpleButton2.Click
        loadGridControl()
    End Sub

    Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles btnChon.Click
        getInfoKh
        Me.Close()
    End Sub
    Dim k As New DTOKhachHang
    Public Sub getInfoKh()
        Makh = k.MaKH
        Tenkh = k.TenKH
    End Sub

    Private Sub GView_RowCellClick(sender As Object, e As DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs) Handles GView.RowCellClick
        k.TenKH = Convert.ToString(GView.GetFocusedRowCellValue("TenKH"))
        k.MaKH = Convert.ToInt16(GView.GetFocusedRowCellValue("MaKH"))
    End Sub
End Class